package buber.web;

import java.io.IOException;

import javax.imageio.ImageIO;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import buber.view.Imager;


public class ImgGeneratorServlet extends HttpServlet{
	public void doGet(HttpServletRequest req,HttpServletResponse resp){
		resp.setContentType("image/png");
			Imager imager = Imager.getInstance();
			try {
				ImageIO.write(imager.getImage(), "png", resp.getOutputStream());
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
	}
}

